from django.contrib import admin
from .models import Species, Subspecies, Bird

class SpeciesAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('name',)}
    list_display = ('name', 'description', 'is_active')
    list_filter = ('name', 'is_active',)
    search_fields = ('name', 'description')

admin.site.register(Species, SpeciesAdmin)

class SubspeciesAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('name',)}
    list_display = ('name', 'description', 'is_active')
    list_filter = ('name', 'species', 'is_active',)
    search_fields = ('species', 'name', 'description')

admin.site.register(Subspecies, SubspeciesAdmin)

class BirdAdmin(admin.ModelAdmin):
    prepopulated_fields = {'slug': ('mutation',)}
    list_display = ('mutation', 'details', 'image', 'price', 'stock', 'is_active', 'is_bestseller', 'is_featured')
    list_filter = ('mutation', 'is_active',)
    search_fields = ('mutation', 'subspecies', 'details')

admin.site.register(Bird, BirdAdmin)